package com.wasu.constant

import com.alibaba.fastjson.JSONObject
import com.wasu.sdk_ott.http.live.getLiveRegion
import com.wasu.sdk_ott.utils.WasuTvModelUtil

object LiveChannel {
    fun queryCommonParam(category: String? = null,jsonObject: JSONObject){
        val category = if (category.isNullOrEmpty()) SYSTEM_CATEGORY_4K_IPDVB_LIVE else category
        when(category){
            SYSTEM_CATEGORY_4K_IPDVB_KANBA, SYSTEM_CATEGORY_4K_IPDVB_QIUSUO -> {
                jsonObject["code"] = DEFAULT_REGION
                jsonObject["usergroupId"] = DEFAULT_USER_GROUP_ID
            }
            else -> {
                jsonObject["code"] = getLiveRegion()
                //todo LC 待确认 usergroupId 参数是否需要
            }
        }
        jsonObject["category"] = SYSTEM_CATEGORY_4K_IPDVB_LIVE
        jsonObject["appId"] = IP_SYSTEM_APP_ID
        jsonObject["appKey"] = IP_SYSTEM_APP_KEY
        jsonObject["timeStamp"] = System.currentTimeMillis().toString()
        jsonObject["nonceStr"] = WasuTvModelUtil.getUUID()
    }
}